import http from './public'

// 以下为乘客接口

// 乘客登录
export const passengerLogin = (params) => {
  return http.fetchPost('https://192.168.137.1:8811/passenger/login', params)
}

// 判断乘客是否登录
export const checkPassengerLogin = (params) => {
  return http.fetchGet('https://192.168.137.1:8811/passenger/checkLogin', params)
}

// 预估价格
export const orderForecast = (params) => {
  return http.fetchGet('https://192.168.137.1:8811/passenger/order/forecast', params)
}

// 派单
export const dispatch = (params) => {
  return http.fetchPost('https://192.168.137.1:8811/passenger/order/dispatch', params)
}

// 获取订单详情
export const checkOrderRedis = (params) => {
  return http.fetchGet('https://192.168.137.1:8811/getOrderRedis', params)
}

// 获取车辆详情
export const checkCarInfo = (params) => {
  return http.fetchGet('https://192.168.137.1:8811/checkCarInfo', params)
}

//以下为司机接口

// 司机登录
export const driverLogin = (params) => {
  return http.fetchPost('https://192.168.137.1:8812/driver/login', params)
}

// 判断司机是否登录
export const checkDriverLogin = (params) => {
  return http.fetchGet('https://192.168.137.1:8812/driver/checkLogin', params)
}

// 司机抢单
export const grabOrder = (params) => {
  return http.fetchPost('https://192.168.137.1:8812/driver/order/grab', params)
}

// 司机去接乘客
export const receiving = (params) => {
  return http.fetchPost('https://192.168.137.1:8812/driver/order/receiving', params)
}

// 开始行程
export const startJourney = (params) => {
  return http.fetchPost('https://192.168.137.1:8812/driver/order/start', params)
}

// 手动结束行程
export const endJourney = (params) => {
  return http.fetchPost('https://192.168.137.1:8812/driver/order/end', params)
}

// 发起收款
export const charge = (params) => {
  return http.fetchPost('https://192.168.137.1:8812/driver/order/charge', params)
}
